<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录欢迎页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f4f4f9;
        }
        h1 {
            font-size: 2rem;
            color: #333;
        }
    </style>
</head>
<body>
<h1>你好, <span id="employeeName">加载中...</span> 登录！</h1>

<script>
    // 模拟从后端获取Employee对象并存储在sessionStorage
    // 假设这里我们已经成功登录并将Employee对象存入sessionStorage
    var employee = {
        name: "张三"
    };

    // 将员工对象存入sessionStorage
    sessionStorage.setItem("Employee", JSON.stringify(employee));

    // 从sessionStorage读取Employee对象
    var employeeData = JSON.parse(sessionStorage.getItem("Employee"));

    // 如果sessionStorage中有Employee数据，更新页面
    if (employeeData && employeeData.name) {
        document.getElementById("employeeName").innerText = employeeData.name;
    } else {
        document.getElementById("employeeName").innerText = "未登录";
    }
</script>
</body>
</html>
